{include file="common/_meta" /}
<title>用户管理</title>
<meta name="keywords" content="李志立，lizhilimaster@163.com">
<meta name="description" content="李志立，lizhilimaster@163.com">
</head>
<body>
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 用户中心 <span class="c-gray en">&gt;</span>
		用户群管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
		 title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
	<div class="page-container">
		<div class="text-c">
			<form action="" method="get">
				<input type="text" class="input-text" style="width:250px" placeholder="输入标题" value="{$key}" name="key">
				<button type="submit" class="btn btn-success radius"><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
			</form>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20" id="xian" > <span class="l">
	<a class="btn btn-primary radius" data-title="添加用户" onclick="user_add('添加用户','{:url('imGroup/add')}','900','700')"
   href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加群</a>
		</span>
			<span class="r">
		共有数据：<strong>{$count1}</strong>
				条</span>
		</div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th width="20">ID</th>
						<th width="100">头像</th>
						<th width="50">编号</th>
						<th width="40">标题</th>
					 	<th width="90">创建时间</th>
						<th width="50">查看成员</th>
						<th width="50">聊天记录</th>
						<th width="50">操作</th>
					</tr>
				</thead>
				<tbody>
					{volist name="user" id="vo"}
					<tr class="text-c">
						<td>{$vo.id}</td>
						<td>
							{if $vo.img}
							<img src="{$vo.img}" height="80">
							{else /}
							没有上传头像
							{/if}
						</td>
						<td>{$vo.group_no}</td>
						<td>{$vo.title}</td>
						<td>{$vo.create_time|date='Y-m-d H:i:s'}</td>
						<td class="td-status">
							<button onclick="user_add('查看成员','{:url('imGroup/friend',[\'id\'=>$vo.id])}','900','700')" type="button" class="btn btn-secondary radius">查看成员</button>
						</td>
						<td class="td-status">
							<button onclick="user_add('聊天记录','{:url('imGroup/show',[\'id\'=>$vo.id])}','900','700')" type="button" class="btn btn-secondary radius">聊天记录</button>
						</td>
						<td class="f-14 td-manage">
							<a style="text-decoration:none" class="ml-5"
							   onclick="user_add('编辑','{:url('imGroup/edit',['id'=>$vo.id])}','900','700')"
							   href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>

							{if $vo.id > 1}
							<a style="text-decoration:none" class="ml-5" onclick="article_del(this,{$vo.id})"  href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
							{/if}

						</td>
					</tr>
					{/volist}
				</tbody>
			</table>
			{$user|raw}
		</div>
	</div>
	{include file="common/_footer" /}
	<script type="text/javascript">
		/*用户-添加*/
		function user_add(title, url, w, h) {
			layer_show(title, url, w, h);
		}
		function article_edit(title, url, w, h) {
			var index = layer.open({
				type: 2,
				title: title,
				content: url
			});
			layer.full(index);
		}
		/*资讯-删除*/
		function article_del(obj, id) {
			layer.confirm('确认要删除吗？', function(index) {
				$.post(
						"{:url('imGroup/ajax')}", {
							id: id,
							type: 'del',
						},
						function(result) {
							if (result.code  === 1) {
								$(obj).parents("tr").remove();
								layer.msg('已删除!', {
									icon: 1,
									time: 1000
								});

							} else {
								layer.msg('删除失败!', {
									icon: 5,
									time: 1000
								});
							}
						});
			});
		}

	</script>
</body>
</html>
